package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.bo.wjjBO.WXBrandDetailBO;
import com.cskaoyan.bean.bo.wjjBO.WXBrandListBO;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.marketBean.MarketBrand;
import com.cskaoyan.bean.vo.wjjVO.WXBrandListVO;
import com.cskaoyan.service.wx.WXBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wjj
 * @date 2023-01-02 10:19
 * @describe
 */
@RequestMapping("wx")
@RestController
public class WXBrandController {

    @Autowired
    WXBrandService brandService;

    /**
     * Request URL: http://localhost:8083/wx/brand/list?page=1&limit=10
     * Request Method: GET
     */
    @RequestMapping("brand/list")
    public BaseRespVo brandList(WXBrandListBO brandListBO){
        WXBrandListVO brandListVO = brandService.selectMarkBrandList(brandListBO);
        return BaseRespVo.ok(brandListVO);
    }

    /**
     * Request URL: http://182.92.235.201:8083/wx/brand/detail?id=1001000
     * Request Method: GET
     */
    @RequestMapping("brand/detail")
    public BaseRespVo brandDetail(WXBrandDetailBO brandDetailBO){
        MarketBrand brand = brandService.selectMarkBrandById(brandDetailBO);
        return BaseRespVo.ok(brand);
    }
}
